<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <h1>这是a页面</h1>
    <script>
        var str = window.location.search;
        var res = str.substr(1);

        function s2o(res) {
            var arr = res.split("&");
            var obj = {};
            for (var i = 0; i < arr.length; i++) {
                var stra = arr[i].split("=");
                console.log(stra);
                obj[stra[0]] = stra[1];
            }
            return obj;
        }
        console.log(s2o(res));
    </script>
</body>

</html>